@charset "utf-8";

@import '../variable';

/**
 *
 * @Select.css
 * @author xinxuzhang
 * @create 15-06-18
 *
**/

select {
	display: inline-block;
	height: 40px;
	margin: 0;
	border: 1px solid $borderNormal;
	border-right-width: 27px;
	opacity: 0.0001;
	font-size: 14px;
	font-family: simsun;
	filter: alpha(opacity=0);
	vertical-align: middle;
}
select[multiple] {
	height: auto;
	font-size: 38px;
	font-size: calc(34px - 1px);
	font-family: simsun;
	padding: 0;
	vertical-align: top;
	border-right-width: 1px;
	cursor: pointer;
}
select[multiple] > option {
	min-height: 38px;
	height: 38px;
	padding: 0;
}
select[multiple] > option:disabled {
	cursor: default;
}
select[hidden],
select[hidden] + .ui-select {
	display: none;
}

.ui-select {
	display: inline-block;
	height: 40px; line-height: 20px;
	vertical-align: middle;
	-webkit-animation: fadeIn .2s;
	animation: fadeIn .2s;
	font-size: 14px;
	position: relative;
}
[multiple] ~ .ui-select {
	vertical-align: top;
}

.ui-select.active {
	z-index: 3;
}

.ui-select-button {
	display: block;
	height: 20px;
	padding: 9px 27px 9px 12px;
	color: $dark;
	border: 1px solid $borderNormal;
	border-radius: $borderRadius;
	background-color: $white;
	text-decoration: none;
	-webkit-transition: border-color .15s, background-color .15s;
	transition: border-color .15s, background-color .15s;
	cursor: pointer;
}

.ui-select-button:hover {
	color: $dark;
	border-color: $borderHover;
}

:not(:disabled) + .ui-select > .ui-select-button:active {
	background-color: $light;
}

.active > a.ui-select-button {
	border-color: $borderFocus;
	border-radius: $borderRadius $borderRadius 0 0;
}

.reverse > a.ui-select-button {
	border-radius: 0 0 $borderRadius $borderRadius;
}

.ui-select-text {
	display: block;
	width: 100%;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}

.ui-select-icon {
	position: absolute;
	width: 20px;
	height: 20px;
	background: url(#{$urlImage}/Select/icon-arrow.png) no-repeat center;
	background: url() no-repeat center, none;
	background-size: 20px 20px;
	right: 7px;
	top: 10px;
}

.ui-select-datalist {
	position: absolute;
	left: 0; right:0;
	top: 39px;
	display: none;
	max-height: 304px;
	padding: 0;
	border: 1px solid $borderFocus;
	background-color: #fff;
	overflow: auto;
}
[multiple] ~ .ui-select > .ui-select-datalist {
	position: static;
	display: block;
	max-height: none;
	height: inherit;
	border-color: $borderNormal;
	border-radius: $borderRadius;
	-ms-box-sizing: border-box;
	box-sizing: border-box;
}
[multiple]:hover ~ .ui-select > .ui-select-datalist {
	border-color: $borderHover;
}
[multiple]:focus ~ .ui-select > .ui-select-datalist {
	border-color: $borderFocus;
}

.ui-select-datalist::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.ui-select-datalist::-webkit-scrollbar-thumb {
  background-color: #bbb;
  border-radius: 8px;
}
.ui-select-datalist::-webkit-scrollbar-thumb:hover {
  background-color: #aaa;
}
.ui-select-datalist::-webkit-scrollbar-track-piece {
  background-color: #ddd;
}

.active > .ui-select-datalist {
	display: block;
}

.reverse > .ui-select-datalist {
	top: auto; bottom: 39px;
}

.ui-select-datalist-li {
	display: block;
	line-height: 20px;
	padding: 9px 12px;
	color: $dark;
	background-color: $backgroundList;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
	-webkit-transition: background-color .15s;
	transition: background-color .15s;
	overflow: hidden;
	cursor: pointer;
}

.ui-select-datalist-li:empty {
	display: none;
}
/* reset default a:hover */
.ui-select-datalist-li:hover {
	color: $dark;
}
.ui-select-datalist-li[href]:hover,
[multiple] ~ .ui-select .ui-select-datalist-li[href] {
	color: $dark;
	background-color: $backgroundListHover;
}

.ui-select-datalist > .selected {
	background-color: $backgroundListSelected;
}

/* disabled */
select[disabled] {
	cursor: default;
}
select[disabled] + .ui-select {
	opacity: .4;
	filter: alpha(opacity=40);
	-webkit-animation: none;
	animation: none;
}
select[disabled] + .ui-select .ui-select-button,
select[disabled] + .ui-select .ui-select-datalist {
	cursor: default;
	border-color: $borderHover;
}

/* error */
.error .ui-select-button,
.error[multiple] ~ .ui-select .ui-select-datalist {
	border-color: $red;
}